package com.itheima.test;

public class test8 {
    public static void main(String[] args) {
        //解密，对应test6

        //定义数组记录加密后的密码
        int[] arr = {8,3,4,6};

        //2.反转
        for(int i=0,j=arr.length-1;i<j;i++,j--){
            int temp = arr[i];
            arr[i] = arr[j];
            arr[j] = temp;
        }

        for(int i=0;i<arr.length;i++){
            if(arr[i]>=0 && arr[i]<=4){
                arr[i]  =arr[i]+10;
            }
            //每一位都减去5
            arr[i]-=5;
        }

        //获取数组中每一位数字并拼接成数组
        int number = 0;
        for(int i=0;i<arr.length;i++){
            number = number *10+arr[i];
        }
        System.out.println(number);

    }
}
